package com.bz.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


@Slf4j
@Controller
public class RoomController {

    @GetMapping("/index")
    public String index() {
        return "index";
    }

    @GetMapping("/user/{userId}")
    public String user(@PathVariable String userId, Model model) {
        // 将用户对象添加到模型中
        model.addAttribute("userId", userId);
        return "user";
    }

    @GetMapping("/login")
    public String login() {
        return "login";
    }

    @GetMapping("/userSse/{userId}")
    public String userSse(@PathVariable String userId, Model model) {
        // 将用户对象添加到模型中
        model.addAttribute("userId", userId);
        return "userSse";
    }

}
